﻿<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
  <Rule
    Name="CUDA_Build_Rule"
    PageTemplate="tool"
    DisplayName="CUDA Build Rule"
    Order="200">
    <Rule.DataSource>
      <DataSource
        Persistence="ProjectFile"
        ItemType="CUDA_Build_Rule" />
    </Rule.DataSource>
    <Rule.Categories>
      <Category
        Name="General">
        <Category.DisplayName>
          <sys:String>General</sys:String>
        </Category.DisplayName>
      </Category>
      <Category
        Name="Command Line"
        Subtype="CommandLine">
        <Category.DisplayName>
          <sys:String>Command Line</sys:String>
        </Category.DisplayName>
      </Category>
    </Rule.Categories>
    <StringListProperty
      Name="Inputs"
      Category="Command Line"
      IsRequired="true"
      Switch=" ">
      <StringListProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          ItemType="CUDA_Build_Rule"
          SourceType="Item" />
      </StringListProperty.DataSource>
    </StringListProperty>
    <BoolProperty
      Name="Debug"
      HelpContext="0"
      DisplayName="Generate Debug Information"
      Description="Specifies whether or not debugging information is generated by the CUDA compiler.  (-D_DEBUG)"
      Switch="-D_DEBUG" />
    <BoolProperty
      Name="Emulation"
      HelpContext="0"
      DisplayName="Emulation Mode"
      Description="Whether or not to generate emulated code."
      Switch="-deviceemu -D_DEVICEEMU" />
    <BoolProperty
      Name="FastMath"
      Subcategory="Default"
      HelpContext="0"
      DisplayName="Use Fast Math"
      Description="Make use of the fast math library."
      Switch="-use_fast_math" />
    <BoolProperty
      Name="PtxAsOptionV"
      HelpContext="0"
      DisplayName="Verbose PTXAS Output"
      Switch="--ptxas-options=-v" />
    <BoolProperty
      Name="CInterleavedPTX"
      HelpContext="0"
      DisplayName="Interleave C in PTXAS Output"
      Switch="--opencc-options -LIST:source=on" />
    <BoolProperty
      Name="Keep"
      Category="Preprocessor"
      HelpContext="0"
      DisplayName="Keep preprocessed files (.ptx, .cubin, cudafe1.c, cudafe1.cpp, cudafe1.gpu, etc.)"
      Description="Specifies that preprocessor files generated by the CUDA compiler are not deleted."
      Switch="--keep" />
    <BoolProperty
      Name="TypeInfo"
      Category="Hybrid CUDA/C++ Options"
      HelpContext="0"
      DisplayName="Enable Run-Time Type Info"
      Description="Adds code for checking C++ object types at run time (runtime type information). (/GR)"
      Switch="/GR" />
    <StringListProperty
      Name="Include"
      HelpContext="0"
      DisplayName="Additional Include Directories"
      Description="Specifies one or more directories to add to the include path; use semi-colon delimited list if more than one.  (/I[path])"
      Separator=";"
      Switch="-I&quot;[value]&quot;" />
    <StringProperty
      Name="ExtraNvccOptions"
      HelpContext="0"
      DisplayName="Extra Options"
      Description="Supply any additional command line options to NVCC"
      Switch="[value]" />
    <StringListProperty
      Name="Defines"
      Category="Preprocessor"
      HelpContext="0"
      DisplayName="Preprocessor Definitions"
      Description="Specifies one or more preprocessor defines.  (-D[macro])"
      Separator=";"
      Switch="-D[value]" />
    <StringProperty
      Name="AddedDependencies"
      HelpContext="0"
      DisplayName="Source Dependencies"
      Description="Add additional CUDA file dependencies"
      Switch="[value]" />
    <StringProperty
      Name="ExtraCppOptions"
      Category="Hybrid CUDA/C++ Options"
      HelpContext="0"
      DisplayName="Extra C++ Options"
      Description="Supply any additional command line options to the host C++ compiler"
      Switch="[value]" />
    <EnumProperty
      Name="NvccCompilation"
      HelpContext="0"
      DisplayName="NVCC Compilation Type"
      Description="Select desired output of NVCC compilation (-c/-compile, -cuda, -gpu, -cubin, -ptx)">
      <EnumValue
        Name="0"
        DisplayName="Generate hybrid object file  (--compile / -c)"
        Switch="--compile -o &quot;$(IntDir)\$(InputName).cu.obj&quot;" />
      <EnumValue
        Name="1"
        DisplayName="Generate hybrid .c file  (-cuda)"
        Switch="-cuda -o &quot;$(IntDir)\$(InputName).cu.c&quot;" />
      <EnumValue
        Name="2"
        DisplayName="Generate .gpu file  (-gpu)"
        Switch="-gpu -o &quot;$(IntDir)\$(InputName).gpu&quot;" />
      <EnumValue
        Name="3"
        DisplayName="Generate .cubin file  (-cubin)"
        Switch="-cubin -o &quot;data\$(InputName).cubin&quot;" />
      <EnumValue
        Name="4"
        DisplayName="Generate .ptx file  (-ptx)"
        Switch="-ptx -o &quot;data\$(InputName).ptx&quot;" />
    </EnumProperty>
    <EnumProperty
      Name="compileout"
      HelpContext="0"
      DisplayName="Compiler Output (obj/cubin)"
      Description="Sets output as an OBJ or cubin file">
      <EnumValue
        Name="0"
        DisplayName="&quot;$(IntDir)/$(InputName).cu.obj&quot;"
        Switch="&quot;$(IntDir)/$(InputName).cu.obj&quot;" />
      <EnumValue
        Name="1"
        DisplayName="&quot;data/$(InputName).cubin&quot;"
        Switch="&quot;data/$(InputName).cubin&quot;" />
      <EnumValue
        Name="2"
        DisplayName="&quot;data/$(InputName).ptx&quot;"
        Switch="&quot;data/$(InputName).ptx&quot;" />
    </EnumProperty>
    <EnumProperty
      Name="Arch"
      HelpContext="0"
      DisplayName="GPU Architecture"
      Description="Select option for the GPU architecture to use on the command line (-arch sm_10, sm_11, sm_12, sm_13)">
      <EnumValue
        Name="10"
        DisplayName="sm_10"
        Switch="-arch sm_10" />
      <EnumValue
        Name="11"
        DisplayName="sm_11"
        Switch="-arch sm_11" />
      <EnumValue
        Name="12"
        DisplayName="sm_12"
        Switch="-arch sm_12" />
      <EnumValue
        Name="13"
        DisplayName="sm_13"
        Switch="-arch sm_13" />
    </EnumProperty>
    <EnumProperty
      Name="CompilerPath"
      HelpContext="0"
      DisplayName="Path to nvcc.exe"
      Description="Specifies the path to the CUDA compiler, nvcc.exe ">
      <EnumValue
        Name="0"
        DisplayName="Installed Toolkit (uses CUDA_BIN_PATH environment varible)"
        Switch="$(CUDA_BIN_PATH)\nvcc.exe" />
      <EnumValue
        Name="1"
        DisplayName="Use Alternate path to CUDA, specified below"
        Switch="&quot;[AlternateNvccPath]&quot;" />
      <EnumValue
        Name="2"
        DisplayName="Use C:\CUDA\bin\nvcc.exe"
        Switch="C:\CUDA\bin\nvcc.exe" />
      <EnumValue
        Name="3"
        DisplayName="Use C:\CUDA\bin64\nvcc.exe"
        Switch="C:\CUDA\bin64\nvcc.exe" />
    </EnumProperty>
    <StringProperty
      Name="AlternateNvccPath"
      HelpContext="0"
      DisplayName="Alternate path to nvcc.exe (non-standard installation)"
      Switch="[value]\nvcc.exe" />
    <EnumProperty
      Name="Warning"
      Category="Hybrid CUDA/C++ Options"
      HelpContext="0"
      DisplayName="Warning Level"
      Description="Select how strict you want the compiler to be about checking for potentially suspect constructs.   (/W0 - /W4)">
      <EnumValue
        Name="0"
        DisplayName="Off: Turn Off All Warnings (/W0)"
        Switch="/W0" />
      <EnumValue
        Name="1"
        DisplayName="Level 1 (/W1)"
        Switch="/W1" />
      <EnumValue
        Name="2"
        DisplayName="Level 2 (/W2)"
        Switch="/W2" />
      <EnumValue
        Name="3"
        DisplayName="Level 3 (/W3)"
        Switch="/W3" />
      <EnumValue
        Name="4"
        DisplayName="Level 4 (/W4)"
        Switch="/W4" />
    </EnumProperty>
    <EnumProperty
      Name="Optimization"
      HelpContext="0"
      DisplayName="Optimization"
      Description="Select option for code optimization; choose Custom to use specific optimization options.  (/Od, /O1, /O2, /Ox)">
      <EnumValue
        Name="0"
        DisplayName="Disabled (/Od)"
        Switch="/Od" />
      <EnumValue
        Name="1"
        DisplayName="Minimize Size (/O1)"
        Switch="/O1" />
      <EnumValue
        Name="2"
        DisplayName="Maximize Speed (/O2)"
        Switch="/O2" />
      <EnumValue
        Name="3"
        DisplayName="Full Optimization (/Ox)"
        Switch="/Ox" />
    </EnumProperty>
    <EnumProperty
      Name="RuntimeChecks"
      Category="Hybrid CUDA/C++ Options"
      HelpContext="0"
      DisplayName="Basic Runtime Checks"
      Description="Perform basic runtime error checks, incompatible with any optimization type other than debug.   (/RTCs, /RTCu, /RTC1)">
      <EnumValue
        Name="0"
        DisplayName="Default"
        Switch=" " />
      <EnumValue
        Name="1"
        DisplayName="Stack Frames (/RTCs)"
        Switch="/RTCs" />
      <EnumValue
        Name="2"
        DisplayName="Uninitialized Variables (/RTCu)"
        Switch="/RTCu" />
      <EnumValue
        Name="3"
        DisplayName="Both (/RTC1, equiv. to /RTCsu)"
        Switch="/RTC1" />
    </EnumProperty>
    <EnumProperty
      Name="Runtime"
      Category="Hybrid CUDA/C++ Options"
      HelpContext="0"
      DisplayName="Runtime Library"
      Description="Specify runtime library for linking.   (/MT, /MTd, /MD, /MDd, /ML, /MLd)">
      <EnumValue
        Name="0"
        DisplayName="Multi-Threaded (/MT)"
        Switch="/MT" />
      <EnumValue
        Name="1"
        DisplayName="Multi-Threaded Debug (/MTd)"
        Switch="/MTd" />
      <EnumValue
        Name="2"
        DisplayName="Multi-Threaded DLL (/MD)"
        Switch="/MD" />
      <EnumValue
        Name="3"
        DisplayName="Multi-Threaded Debug DLL (/MDd)"
        Switch="/MDd" />
      <EnumValue
        Name="4"
        DisplayName="Single-Threaded (/ML)"
        Switch="/ML" />
      <EnumValue
        Name="5"
        DisplayName="Single-Threaded Debug (/MLd)"
        Switch="/MLd" />
    </EnumProperty>
    <IntProperty
      Name="MaxRegCount"
      HelpContext="0"
      DisplayName="maxrregcount"
      Switch="-maxrregcount=[Value]" />
    <StringProperty
      Name="CommandLineTemplate"
      DisplayName="Command Line"
      Visible="False"
      IncludeInCommandLine="False" />
    <DynamicEnumProperty
      Name="CUDA_Build_RuleBeforeTargets"
      Category="General"
      EnumProvider="Targets"
      IncludeInCommandLine="False">
      <DynamicEnumProperty.DisplayName>
        <sys:String>Execute Before</sys:String>
      </DynamicEnumProperty.DisplayName>
      <DynamicEnumProperty.Description>
        <sys:String>Specifies the targets for the build customization to run before.</sys:String>
      </DynamicEnumProperty.Description>
      <DynamicEnumProperty.ProviderSettings>
        <NameValuePair
          Name="Exclude"
          Value="^CUDA_Build_RuleBeforeTargets|^Compute" />
      </DynamicEnumProperty.ProviderSettings>
      <DynamicEnumProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          HasConfigurationCondition="true" />
      </DynamicEnumProperty.DataSource>
    </DynamicEnumProperty>
    <DynamicEnumProperty
      Name="CUDA_Build_RuleAfterTargets"
      Category="General"
      EnumProvider="Targets"
      IncludeInCommandLine="False">
      <DynamicEnumProperty.DisplayName>
        <sys:String>Execute After</sys:String>
      </DynamicEnumProperty.DisplayName>
      <DynamicEnumProperty.Description>
        <sys:String>Specifies the targets for the build customization to run after.</sys:String>
      </DynamicEnumProperty.Description>
      <DynamicEnumProperty.ProviderSettings>
        <NameValuePair
          Name="Exclude"
          Value="^CUDA_Build_RuleAfterTargets|^Compute" />
      </DynamicEnumProperty.ProviderSettings>
      <DynamicEnumProperty.DataSource>
        <DataSource
          Persistence="ProjectFile"
          ItemType=""
          HasConfigurationCondition="true" />
      </DynamicEnumProperty.DataSource>
    </DynamicEnumProperty>
    <StringListProperty
      Name="Outputs"
      DisplayName="Outputs"
      Visible="False"
      IncludeInCommandLine="False" />
    <StringProperty
      Name="ExecutionDescription"
      DisplayName="Execution Description"
      Visible="False"
      IncludeInCommandLine="False" />
    <StringListProperty
      Name="AdditionalDependencies"
      DisplayName="Additional Dependencies"
      IncludeInCommandLine="False"
      Visible="false" />
    <StringProperty
      Subtype="AdditionalOptions"
      Name="AdditionalOptions"
      Category="Command Line">
      <StringProperty.DisplayName>
        <sys:String>Additional Options</sys:String>
      </StringProperty.DisplayName>
      <StringProperty.Description>
        <sys:String>Additional Options</sys:String>
      </StringProperty.Description>
    </StringProperty>
  </Rule>
  <ItemType
    Name="CUDA_Build_Rule"
    DisplayName="CUDA Build Rule" />
  <FileExtension
    Name="*.cu"
    ContentType="CUDA_Build_Rule" />
  <ContentType
    Name="CUDA_Build_Rule"
    DisplayName="CUDA Build Rule"
    ItemType="CUDA_Build_Rule" />
</ProjectSchemaDefinitions>